<template>
	<view>
        <view class="header-cont">
			<view class = "nav" catchtouchmove="true">
				<view :class="navIndex==1?'activite':''" @click="checkIndex(1)">未审核</view>
				<view :class="navIndex==2?'activite':''" @click="checkIndex(2)">已审核</view>
			</view>
		</view>
		<view class="body">
			<view class="content" v-if="navIndex==1">
				<view class="uni-flex uni-row" v-for="(i,index) in nopass" :key="index"> 
					<applylist v-bind:seehouse="i"></applylist>
				</view>
			</view>
			<view class="content" v-if="navIndex==2">
				<view class="uni-flex uni-row" v-for="(j,index) in pass" :key="index"> 
					<applylist v-bind:seehouse="j"></applylist>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import {mapState} from 'vuex';
import applylist from './applylist.vue'
	export default {
		components:{
			applylist
		},
		data() {
			return {
				navIndex:1,
				agentid:2,
				nopass:[],
				pass:[]
			}
		},
		methods: {
			checkIndex(index){
				this.navIndex = index;
			},
			getSeehouseBySellerid(){
				let data = {agentId: this.user.userId}
				this.$axios.post('getSeeHouseByagentid',this.qs.stringify(data))
				.then(res => {
					this.nopass = res.data.nopass
					this.pass = res.data.pass
					console.log(this.nopass)
				})
			}
		},
		onLoad(){
			this.getSeehouseBySellerid()
		},
		computed:{
			...mapState(['user'])
		}
	}
</script>

<style>
	.nav{
    width: 50%;
    margin:20rpx auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
	}

	.activite{
		font-weight: bold;
		border-bottom: 6rpx solid #0065d9;
	}
	
	.nav>view{
		padding-bottom: 10rpx;
	}

</style>
